#!/bin/sh
inputEnv=dev
if [ ! -n "$1" ] ;then
    echo "building for default dev..."
else
    inputEnv=$1
    echo "building for ${inputEnv}..."
fi
rm -rf *-xtest-deploy-*-ear.tar.gz
mvn clean:clean
echo "env=${inputEnv}" > deploy/config/perfma-env.properties
mvn install -Dmaven.test.skip -DpackageEnv=${inputEnv}
cp deploy/target/${inputEnv}-xtest-deploy-*-ear.tar.gz  .